<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="https://cdn.bootcss.com/jquery/3.2.0/jquery.min.js"></script>
<body>
        <div class="aaa" id="aaa" data-index="test">
            <div class="test_1">1</div>
            <div class="test_2">2</div>
            <div class="test_3">3</div>
        </div>
        <script>
            var testaa =$('#aaa').data('index');
            console.log(testaa)
            $('.'+testaa+'_1').on('click',function () {
                alert(11)
            })
        </script>
</body>
</html>